package com.ruoyi.project.charge.pcharge.controller;

import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.charge.pcharge.domain.Charge;
import com.ruoyi.project.charge.pcharge.domain.RegDisease;
import com.ruoyi.project.charge.pcharge.domain.RegOrder;
import com.ruoyi.project.charge.pcharge.service.IPChargeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author : HUA°
 * @date : 16:52 2021/7/14
 */
@RestController
@RequestMapping("/system/pcharge")
public class PChargeController extends BaseController {

    @Autowired
    private IPChargeService ipChargeService;

    @PreAuthorize("@ss.hasPermi('system:pcharge:query')")
    @GetMapping("/list")
    public AjaxResult list(RegDisease regDisease){
        System.out.println(regDisease.getReRrId());

        Map<String,Object> map = ipChargeService.selectByRrId(regDisease.getReRrId());

        return AjaxResult.success(map);
    }


    @PreAuthorize("@ss.hasPermi('system:scharge:query')")
    @GetMapping("/slist")
    public TableDataInfo listCharge(Charge charge){
        System.out.println(charge);
        startPage();
        List<Charge> list = ipChargeService.selectCharge(charge);
        return getDataTable(list);
    }

}
